<!--
 * @Author: wangding
 * @Date: 2020-11-06 16:33:50
 * @LastEditTime: 2020-11-06 16:45:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \solaxcloud\src\views\overview-inverter\alarm\proposal.vue
-->
<template>
    <div>
        <el-dialog
        :title="$t('troubleshooting.afterSale.title')"
        :visible="newVisibleEdit"
        width="650px"
        @close="()=>{$store.commit('setNewVisibleEdit',false)}"
        >
            <div class="proposal-main-box">
                <div class="big-box">
                    <span>{{$t('troubleshooting.reason')}}:</span>
                    <p>{{proposalObj.reason}}</p>
                </div>
                <div class="big-box">
                    <span>{{$t('troubleshooting.tiggerCondition')}}:</span>
                    <p>{{proposalObj.userSuggestion}}</p>
                </div>
                <div class="big-box">
                    <span>{{$t('troubleshooting.recoverCondition')}}:</span>
                    <p>{{proposalObj.recoverCondition}}</p>
                </div>
                <div class="big-box">
                    <span>{{$t('troubleshooting.saleSuggestion')}}:</span>
                    <p>{{proposalObj.saleSuggestion}}</p>
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script>
export default {
    components: {

    },
    props: {
        proposDataList:{
            type:Object,
            default:() =>{return {}}
        }
    },
    data() {
        return {
            proposalObj:{}
        };
    },
    computed: {
        newVisibleEdit(){
            return this.$store.state.sysStore.newVisibleEdit
        }
    },
    watch: {
        proposDataList:{
            handler(nv,ov){
                if(nv){
                    this.alarmPushGetAlarmInfo()
                }
            }
        }
    },
    created() {

    },
    mounted() {
        
    },
    methods: {
        async alarmPushGetAlarmInfo(){
            let res = await this.API.alarmPushGetAlarmInfo({
                deviceType:this.proposDataList.inverterType,
                alarmName:this.proposDataList.errorMessage
            })
            this.proposalObj = res
        }
    },
};
</script>

<style  lang="less" scoped>
.proposal-main-box{
    .big-box{
        line-height: 30px;
        span{
            font-weight: bold;
        }
        p{
            margin: 0;
            color: #6b6b6b;
            line-height: 20px;
            font-size: 13px;
        }
    }
}
</style>
